# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=gthumb
pkgver=3.12.2
pkgrel=5
pkgdesc="Image browser and viewer for the GNOME Desktop"
url="https://wiki.gnome.org/Apps/gthumb"
arch=(x86_64)
license=(GPL)
depends=(dconf librsvg clutter-gtk gst-plugins-base-libs gsettings-desktop-schemas libwebp
         libsecret libsoup webkit2gtk json-glib gst-plugin-gtk libjxl libheif)
makedepends=(exiv2 brasero libraw liboauth docbook-xsl yelp-tools meson git)
optdepends=('libraw: read RAW files'
            'exiv2: metadata support'
            'brasero: burn discs'
            'liboauth: web albums')
_commit=3132c5f25ffe6f22314ab0fbfb08e63ba523afab  # tags/3.12.2^0
source=("git+https://gitlab.gnome.org/GNOME/gthumb.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd gthumb
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd gthumb
  
  # Fix build with libraw 0.21
  git cherry-pick -n da0d3f22a5c3a141211d943e7d963d14090011ec
}

build() {
  arch-meson gthumb build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
